package org.chameleon.datasource.manager.nacos;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.api.config.ConfigService;
import org.chameleon.datasource.convert.JsonConvert;

import java.util.concurrent.Executor;

public class DefaultNacosConfigManager extends AbsNacosConfigManager<JSONObject> {

    public DefaultNacosConfigManager( ConfigService configService) {
        super(new JsonConvert(), configService);
    }

    @Override
    public String getDateId(JSONObject jsonObject) {
        return jsonObject.getString("dateId");
    }

    @Override
    public String getGroup(JSONObject jsonObject) {
        return jsonObject.getString("group");
    }

    @Override
    public Executor getExecutor() {
        return null;
    }

    @Override
    public String buildCacheKey(JSONObject jsonObject) {
        return jsonObject.toString();
    }
}
